package cn.wolfcode.shop.cloud.mq;


import cn.wolfcode.shop.cloud.web.controller.SeckillOrderInfoController;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(
        consumerGroup = MQConstans.CREATE_ORDER_FAIL_NOTIFY_GROUP,
        topic = MQConstans.SECKILL_ORDER_TOPIC,
        selectorExpression = MQConstans.CREATE_ORDER_FAIL_NOTIFY_TAG,
        messageModel = MessageModel.BROADCASTING
)
@Component
public class OrderFailNotifyMQListener implements RocketMQListener<Long> {

    @Override
    public void onMessage(Long goodId) {
        System.out.println("进入到广播队列中");
        SeckillOrderInfoController.isOverSign.put(goodId,false);
    }
}
